package com.cloudlead.plugin.security.vo;

import com.cloudlead.common.lang.persistence.AbstractIdEntity;

import com.cloudlead.plugin.security.action.validator.ScUserHasPrivilegeValidatorGroup.*;

import javax.validation.constraints.Size;
import com.cloudlead.plugin.security.vo.ScPrivilege;
import com.cloudlead.common.lang.annotation.BelongsTos;
import com.cloudlead.common.lang.annotation.Domain;
import com.cloudlead.plugin.security.vo.ScUser;
import java.lang.Boolean;
import com.cloudlead.common.lang.annotation.Label;
import java.lang.String;
import javax.validation.constraints.NotNull;

/**
 * ScUserHasPrivilege is a Codegen vo type
 */
@Domain(domainClassName="com.cloudlead.plugin.security.entity.EScUserHasPrivilege")
@BelongsTos(values = {
	@com.cloudlead.common.lang.annotation.BelongsTo(property="scPrivilege", rootField="scPrivilegeId")
,	@com.cloudlead.common.lang.annotation.BelongsTo(property="scUser", rootField="scUserId")
})
@Label("用户对应的权限")
public class ScUserHasPrivilege extends AbstractIdEntity<String> {

    private static final long serialVersionUID =1743713809262L;    
    @NotNull(groups={Update.class})
    @Size(max=24)
    @Label("编号")
    private String id;

    @Label("允许或禁止")
    private Boolean isPermission;

    @NotNull(groups={Create.class,Update.class})
    @Label("所属权限")
    private ScPrivilege scPrivilege;

    @NotNull(groups={Create.class,Update.class})
    @Label("所属用户")
    private ScUser scUser;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Boolean getIsPermission() {
        return isPermission;
    }

    public void setIsPermission(Boolean isPermission) {
        this.isPermission = isPermission;
    }

    public ScPrivilege getScPrivilege() {
        return scPrivilege;
    }

    public void setScPrivilege(ScPrivilege scPrivilege) {
        this.scPrivilege = scPrivilege;
    }

    public ScUser getScUser() {
        return scUser;
    }

    public void setScUser(ScUser scUser) {
        this.scUser = scUser;
    }

    public String toString() {
         return String.format("ScUserHasPrivilege { id : %s,isPermission : %s,scPrivilege : %s,scUser : %s }",id,isPermission,scPrivilege,scUser);
    }

}

